#ifndef _BACKDROP_EDITOR_SCROLL_H_
#define _BACKDROP_EDITOR_SCROLL_H_

#include "backdrop_editor.h"

namespace backdrop
{
class BackdropScroll;
class BackdropLayer;

class BackdropEditorScroll : public BackdropEditor
{
public:
	BackdropEditorScroll(BackdropScroll* pBackdrop);
	virtual ~BackdropEditorScroll();

	bool				GetCurrentLayer(int* piLayer = NULL, bool* pbForeground = NULL);
	BackdropLayer*		GetCurrentLayerPtr();
	virtual void		Tick(float dt);
	virtual void		KeyPressed(input::Keyboard::KEY* pKey);
	virtual void		SetDecalBrush(const std::string& Name, const std::string& Type = "");

	BackdropScroll*		GetScrollBackdrop() { return (BackdropScroll*)m_pBackdrop; }
	virtual math::Vec2	GetOffset() const;

	virtual float		GetScrollSpeed() const { return 1.0f; }
	virtual float		GetScrollEdge() const { return 0.01f; }
	virtual int			MaxLayers() const { return 4; }
	virtual bool		AllowLayerEdit() const { return false; }

protected:
	void				ToggleUVScroll();
	void				DeleteLayerBackground();
	void				ChangeLayer(bool bIncrement = true);
	void				SetParallax(bool bIncrement = true);
	void				MoveLayer(bool bForward = true);

	virtual void		BackgroundFunction() {}
	virtual void		DecalsFunction() {}
	virtual void		SaveFunction(bool QuickSave = false) {}
	virtual void		LoadFunction() {}
	virtual void		ExitFunction() {}
	virtual void		ClearAllFunction() {}

	virtual void		RefreshAltText();
	virtual void		EnableLayers(bool QuitEditor = false);

private:
	virtual void		RenderGridLines();

protected:
	int					m_CurrentLayer;

private:
	bool				m_LayerHighlightInit;
};

}  //namespace backdrop

#endif //_BACKDROP_EDITOR_SCROLL_H_
